<template>
    <div class="demon" v-if="store.count.length>0">
        <div>已选条件:</div>
        <div class="demon_two">
            <div class="demon_cox" v-for="item in store.count" :key="item">
                {{ item.name }}
                <span style="margin-right:5px;" v-for="ele in item.value" :key="ele">
                    <span v-if="item.name == '地区：'" v-for="lll in ele.name" :key="lll" style="margin-right:3px;"> <span v-for="aa in lll" :key="aa">{{ aa }}</span></span>    
                    <span v-else-if="item.name == '公告类型：'" v-for="ll in ele.name" :key="ll" style="margin-right:3px;">{{ ll.name }}</span>    
                    <span v-else>{{ ele.name }}</span> 
                </span>
            </div>
        </div>
        <div class="demon_three" @click="removals">
            <span class="demon_three-span">清空</span>
            <el-icon :size="14">
                <Delete />
            </el-icon>
        </div>
    </div>
</template>

<script setup>
import { onMounted, ref } from 'vue'
import { useSearchStore } from '@/pain/search/search';
const store = useSearchStore()
onMounted(() => {
    console.log('113132', store.count)
});
// 清除
const removals = () => {
    store.count = []
    console.log('113132', store.count)
}
</script>

<style lang="scss" scoped>
.demon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 15px 20px;
    
    .demon_two {
        flex: 1;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        .demon_cox {
            margin: 3px 0 0 15px;
            padding: 5px 10px;
            background-color: #E6E9FF;
            border-radius: 50px;
            font-size: 14px;
            color: #6675FF;
        }
    }

    .demon_three {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 86px;
        height: 34px;
        background-color: #FFE2E2;
        color: #FF4848;
        border-radius: 50px;
        cursor: pointer;

        .demon_three-span {
            margin-right: 5px;
        }
    }
}
</style>